﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8;" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/Homepage/style.css">
<link href="__PUBLIC__/css/findpw/style.css" type="text/css" rel="stylesheet"></link>
<script type="text/javascript" src="__PUBLIC__/js/jquery-1.11.0.min.js" ></script>
<script type="text/javascript">
	$(function(){
	
	
 		  $(document).keypress(function(e) { 
          // 回车键事件 
		   if(e.which == 13) { 
				$('#submit').trigger("click");
		   } 
		   })
     $('#submit').click(function(){	 
		 userid =$("#userid").val();
		 code = $("#code").val();
		
		 if(userid==""){
				$('#userid_error').text("*请输入账号");
				return false;
			}else{
				$('#userid_error').text("");
			}
	  
		 if(code==""){
				$('#code_error').text("*验证码不能为空");
				return false;

			}
		
		  $.ajax({
             type: "POST",
             url: "{:U('oper')}",
			 data: {from:1,userid:userid,code:code},
			 dataType: "text",
             success: function(data){
					if(data==1){
						alert("验证码错误");
						document.getElementById('codepic').src='{:U('verify')}?'+Math.random();
					}else if(data==2){
						alert("此用户不存在");
					}else if(data==4){
						alert("您没设置密保问题，请联系客服");
					}else if(data==3){
						window.location.href="{:U('question')}";
					}
				 }				 
			})			
     })  
  })

</script></head>
<style>

</style>
<body>
<div class="menu">
	<include file="Public/home_header" />
	<div class="menu1">
		<form  name="myform" id="myform"  method="POST">
			<p class="title">找回密码</p>
			<table class="pw4_title1">
				<tr><td class="pw4_password">账号:</td><td class="pw4_text"><input type="text" name="userid" id="userid"></td><td class="error"><span id="userid_error"  ></span></td></tr>
				<tr>
					<td class="pw4_password">验证码:</td>
					<td class="pw4_text" style="text-align:left;padding-left:24px;"><input type="text" style="width:145px" name="code" id="code"><img  style="cursor:pointer;margin-left:5px;" title="点击刷新" src="{:U('verify')}" onclick="this.src='{:U('verify')}?'+Math.random();" align="absbottom" id="codepic" /></td>
					<td class="error"><span  id="code_error" ></span></td>
					<td></td>
				</tr>
				<tr><td></td><td class="pw4_sure" ><div id="submit" >下&nbsp一&nbsp步</div></td>
			</table>
		</form>
	</div>
	<include file="Public/home_footer" />

</div>
</body></html>